<?xml version="1.0" encoding="ISO-8859-1" ?>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@include file="../../context.jsp"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Monthly Sector Data List</title>
<%@include file="../common_Admin_imports.jsp"%>
<%@include file="../common_list_page.jsp"%>

<script type="text/javascript">
	$(document)
			.ready(
					function() {
						resetSelectAll();
						$('#selectAll').on('click', function() {
							selectAll();
						});
						paginationNextBtn("${pageContext.request.contextPath}/admin/monthlysectordata/list.html?totalRecords=${monthlySectorDataPage.totalNoOfRecords}&page=");
					});

	function deleteFiltered() {
		var proceed = confirm("Are you sure, you want to delete the searched dataset ? If you select yes, the operation cannot be undone");
		if (proceed) {
			var baseUrl = "${pageContext.request.contextPath}/admin/monthlysectordata/deleteFiltered.html";
			document.location = baseUrl;
		}

		return proceed;
	}
</script>
</head>
<body>
	<div class="main_wrapper">
		<div class="header_wrapper">
			<div class="container-fluid">
				<div class="header_inner_wrapper clearfix">
					<div class="row-fluid">
						<div class="header_left span4">List of Monthly sector data</div>
						<div class="header_right span8">
							<!-- search section -->
							<jsp:include page="../search_sector.jsp">
								<jsp:param name="page" value="monthlysectordata" />
							</jsp:include>
							<!-- end of search section -->
						</div>
					</div>
				</div>

				<div class="row-fluid">
					<div class="main_table">
						<form:form method="POST"
							action="${pageContext.request.contextPath}/admin/monthlysectordata/delete/selected.html">
							<table class="table table-bordered table-striped">
								<thead>
									<tr>
										<th id="tableHeader"><input type="checkbox"
											id="selectAll" name="deleteHeader" /></th>
										<th id="tableHeader">No</th>
										<th id="tableHeader">Sector</th>
										<th id="tableHeader">Date</th>
										<th id="tableHeader">Closing Value</th>
										<th id="tableHeader">no Of Trades</th>
										<th id="tableHeader">Volume</th>
										<th id="tableHeader">TurnOver</th>
										<th id="tableHeader">Open</th>
										<th id="tableHeader">High</th>
										<th id="tableHeader">Low</th>
										<th></th>
										<th></th>
									</tr>
								</thead>
								<tbody>
									<c:forEach var="monthlySectorData"
										items="${monthlySectorDataPage.pageData}">
										<tr>
											<td><input type="checkbox" class="selectedId"
												name="deleteIds" value="${monthlySectorData.id}" /></td>
											<td>${monthlySectorData.id}</td>
											<td>${monthlySectorData.sector.name}</td>
											<td id="dateAlign"><fmt:formatDate
													pattern="${dateFormat}" value="${monthlySectorData.date}" /></td>
											<td id="numberAlign"><fmt:formatNumber
													maxFractionDigits="${MaxFraction}"
													minFractionDigits="${MinFraction}"
													value="${monthlySectorData.closingValue}" /></td>
											<td id="numberAlign"><fmt:formatNumber
													maxFractionDigits="${MaxFraction}"
													minFractionDigits="${MinFraction}"
													value="${monthlySectorData.noOfTrades}" /></td>
											<td id="numberAlign"><fmt:formatNumber
													maxFractionDigits="${MaxFraction}"
													minFractionDigits="${MinFraction}"
													value="${monthlySectorData.volume}" /></td>
											<td id="numberAlign"><fmt:formatNumber
													maxFractionDigits="${MaxFraction}"
													minFractionDigits="${MinFraction}"
													value="${monthlySectorData.turnOver}" /></td>
											<!--  -->
											<td id="numberAlign"><fmt:formatNumber
													maxFractionDigits="${MaxFraction}"
													minFractionDigits="${MinFraction}"
													value="${monthlySectorData.open}" /></td>
											<td id="numberAlign"><fmt:formatNumber
													maxFractionDigits="${MaxFraction}"
													minFractionDigits="${MinFraction}"
													value="${monthlySectorData.high}" /></td>
											<td id="numberAlign"><fmt:formatNumber
													maxFractionDigits="${MaxFraction}"
													minFractionDigits="${MinFraction}"
													value="${monthlySectorData.low}" /></td>
											<td><div class="btn btn-info">
													<a
														href="${pageContext.request.contextPath}/admin/monthlysectordata/edit/${monthlySectorData.id}.html">Edit</a>
												</div></td>
											<td><div class="btn btn-danger">
													<a
														lang="${pageContext.request.contextPath}/admin/monthlysectordata/delete/${monthlySectorData.id}.html"
														href="javascript:void(0);"
														onclick="return confirmAndDelete(this);">Delete</a><br />
												</div></td>
										</tr>
									</c:forEach>
								</tbody>
							</table>
							<div>
								<div>
									<input
										onclick="return confirm('Are you sure, you want to delete all the selected results. This opperation cannot be undone');"
										class="btn btn-danger" type="submit" value="Delete Selected" />
									<input onclick="return deleteFiltered();"
										class="btn btn-danger" type="button"
										value="Delete Filtered List" />
								</div>
							</div>
						</form:form>
						<!-- paging section -->
						<div class="pagination pagination-right">
							<!-- page number -->
							Page&nbsp;<input value="${monthlyAspiDataPage.currentPageNo}"
								style="width: 50px;" type="number" min="0"
								max="${monthlyAspiDataPage.totalNoOfPages }" id="pageNum">
								<!-- end page number -->
								<ul>
									<li><c:if test="${monthlySectorDataPage.showPrev}">
											<a
												href="${pageContext.request.contextPath}/admin/monthlysectordata/list.html?page=${monthlySectorDataPage.currentPageNo-1}&totalRecords=${monthlySectorDataPage.totalNoOfRecords}">Prev</a>
										</c:if></li>
									<c:forEach begin="${monthlySectorDataPage.startPageNo}"
										var="page" end="${monthlySectorDataPage.endPageNo}">
										<li><a
											<c:if test="${monthlySectorDataPage.currentPageNo==page}">style="background-color:#79BAEC"</c:if>
											href="${pageContext.request.contextPath}/admin/monthlysectordata/list.html?page=${page}&totalRecords=${monthlySectorDataPage.totalNoOfRecords}">${page}</a></li>&nbsp;
							</c:forEach>
									<li><c:if test="${monthlySectorDataPage.showNext}">
											<a
												href="${pageContext.request.contextPath}/admin/monthlysectordata/list.html?page=${monthlySectorDataPage.currentPageNo+1}&totalRecords=${monthlySectorDataPage.totalNoOfRecords}">Next</a>
										</c:if></li>
									<li><a class="pageCountLink">${monthlySectorDataPage.totalNoOfPages }
											Pages</a></li>
								</ul>
						</div>
						<div>
							<br></br>
						</div>
						<!-- paging section -->
						<div class="btn btn-success">
							<a
								href="${pageContext.request.contextPath}/admin/monthlysectordata/add.html">New</a>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

</body>
</html>